package com.sxpcwlkj.framework.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FrameworkController {


    @Value("${sxpcwlkj.name}")
    private String name;

    @Value("${sxpcwlkj.version}")
    private String version;

    @SaIgnore
    @RequestMapping("/")
    public String index() {
        return "Hello "+name+"! V" + version;
    }

    @SaIgnore
    @ResponseStatus(HttpStatus.NOT_FOUND)
    @RequestMapping("/api/error")
    public String error() {
        return "The path is not found.";
    }


}
